import { MyVue } from 'src/wl/my_vue';
import Vue from 'vue';
import { Component, Emit, Prop, Provide, Watch } from 'vue-property-decorator'
import { AuditTConst } from "src/consts/audit_template_const";
import { PopupName } from "src/consts/popup_const";
@Component({})
export default class AuditTBusinessPanel extends MyVue {
    name: string = 'AuditTBusinessPanel';
    formData: any;
    footerFlag: boolean = true;
    selection: any[]
    titles: String[]
    changeFlag: Boolean

    beforeCreate(): void {
    }

    initData(that?: any): void {
        that.formData = WLStore().state.auditTBusiness;
        that.selection = WLStore().state.auditTShow.bind_business
        that.titles = ['业务名称', '绑定业务']
        that.changeFlag = false
    }

    mounted(): void {
    }

    editBusiness(): void {
        if (this.changeFlag) {
            WLCommit(AuditTConst.CommitBusiness, this.selection)
        } else {
            WLLib.panel(PopupName.AuditT_Business_Panel).close();
        }
    }

    change(val: any): void {
        this.selection = val
        this.changeFlag = true
    }
}